package secondPart.inheritance;

public class Dog extends Animal {
    public int age = 77;
    public Dog() {
        System.out.println("Dog类执行了。");
    }

    public void eat() {
        System.out.println(this.toString());
        System.out.println("年龄: " + age + "dog具有吃东西的能力！");
    }

    public void method() {
        super.eat();
    }

    @Override
    public String toString() {
        return "Dog{" +
                "age=" + age +
                '}';
    }
}
